package com.jskj.actions;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;

import com.jskj.commons.BaseAction;

public class LogoutAction extends BaseAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String _dc;
	
	public String get_dc() {
		return _dc;
	}

	public void set_dc(String _dc) {
		this._dc = _dc;
	}

	private static Logger log=Logger.getLogger(LogoutAction.class);
	
	public void logout() {
		HttpServletRequest req=ServletActionContext.getRequest();
		HttpSession session=req.getSession();
		if (session.getAttribute("username")!=null) {
			session.invalidate();
			log.info("用户退出！");
		}
	}

}
